.invoice-form {
    height: 100vh;
    background-color: #f8f9fa;

    .form-scroll {
        height: 100%;
        padding: 20rpx;
    }

    .form-section {
        background: white;
        border-radius: 20rpx;
        margin-bottom: 24rpx;
        overflow: hidden;
        box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;

        &:hover {
            box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.12);
        }

        .section-header {
            padding: 28rpx 32rpx;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-bottom: 1rpx solid #e8e8e8;

            .section-title {
                color: white;
                font-size: 34rpx;
                font-weight: 600;
                letter-spacing: 1rpx;
            }
        }
    }

    .form-item {
        padding: 32rpx;
        border-bottom: 1rpx solid #f0f0f0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;

        &:last-child {
            border-bottom: none;
        }

        .label {
            font-size: 30rpx;
            color: #333;
            font-weight: 500;
            margin-bottom: 20rpx;
            display: flex;
            align-items: center;

            .required {
                color: #ff4d4f;
                margin-left: 8rpx;
                font-size: 28rpx;
            }
        }

        .picker {
            width: 646px;
            padding: 24rpx;
            border: 2rpx solid #e8e8e8;
            border-radius: 12rpx;
            font-size: 28rpx;
            color: #333;
            background: white;
            transition: all 0.3s ease;

            &:active {
                border-color: #667eea;
                background-color: #f8f9ff;
            }

            &:empty::before {
                content: '请选择';
                color: #999;
            }
        }

        .input {
            width: 100%;
            padding: 0px 24rpx;
            border: 2rpx solid #e8e8e8;
            border-radius: 12rpx;
            font-size: 28rpx;
            background: white;
            transition: all 0.3s ease;
            box-sizing: border-box;
            height: 90px;

            &:focus {
                border-color: #667eea;
                background-color: #f8f9ff;
            }
        }

        .textarea {
            width: 100%;
            padding: 24rpx;
            border: 2rpx solid #e8e8e8;
            border-radius: 12rpx;
            font-size: 28rpx;
            min-height: 160rpx;
            background: white;
            transition: all 0.3s ease;
            box-sizing: border-box;

            &:focus {
                border-color: #667eea;
                background-color: #f8f9ff;
            }
        }

        .upload-container {
            width: 100%;

            .upload-btn {
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                color: white;
                border: none;
                border-radius: 12rpx;
                padding: 20rpx 32rpx;
                font-size: 26rpx;
                margin-bottom: 20rpx;
                transition: all 0.3s ease;

                &:active {
                    transform: scale(0.98);
                    opacity: 0.9;
                }
            }

            .preview-list {
                display: flex;
                flex-wrap: wrap;
                gap: 20rpx;

                .preview-item {
                    position: relative;
                    display: flex;
                    flex-direction: column;
                    align-items: center;

                    .preview-image {
                        width: 140rpx;
                        height: 140rpx;
                        border-radius: 12rpx;
                        border: 2rpx solid #e8e8e8;
                    }

                    .remove-btn {
                        margin-top: 12rpx;
                        background: #ff4d4f;
                        color: white;
                        border: none;
                        border-radius: 8rpx;
                        padding: 8rpx 16rpx;
                        font-size: 22rpx;
                    }
                }
            }
        }
    }

    .form-actions {
        padding: 40rpx 32rpx;
        background: white;
        border-radius: 20rpx;
        margin-top: 24rpx;
        box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);

        .submit-btn {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            border: none;
            border-radius: 16rpx;
            padding: 32rpx;
            font-size: 34rpx;
            font-weight: 600;
            letter-spacing: 2rpx;
            transition: all 0.3s ease;

            &:active {
                transform: scale(0.98);
                opacity: 0.9;
            }
        }
    }
}

// 动画效果
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20rpx);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeIn 0.5s ease-out;
}

// 响应式设计
@media (max-width: 480px) {
    .invoice-form {
        .form-item {
            padding: 24rpx;

            .label {
                font-size: 28rpx;
            }

            .picker,
            .textarea {
                font-size: 26rpx;
                padding: 20rpx;
            }
        }

        .input {
            height: 90px;
        }
    }
}

// 暗色模式支持
@media (prefers-color-scheme: dark) {
    .invoice-form {
        background-color: #1a1a1a;

        .form-section {
            background: #2d2d2d;

            .section-header {
                background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
            }
        }

        .form-item {
            .label {
                color: #e2e8f0;
            }

            .picker,

            .textarea {
                background: #3a3a3a;
                border-color: #4a5568;
                color: #e2e8f0;

                &:focus {
                    background: #4a5568;
                }
            }

            .input {
                height: 90px;
            }
        }
    }

    // 替代的卡片式设计
    .multiple-container {
        width: 100%;

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200rpx, 1fr));
            gap: 20rpx;
            width: 100%;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            padding: 32rpx 20rpx;
            border: 2rpx solid #e8e8e8;
            border-radius: 20rpx;
            background: white;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: center;
            min-height: 120rpx;

            &.checkbox-label--checked {
                border-color: #667eea;
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                color: white;
                box-shadow: 0 8rpx 25rpx rgba(102, 126, 234, 0.3);
                transform: translateY(-4rpx);

                .checkbox-text {
                    color: white;
                    font-weight: 600;
                }

                .custom-checkbox {
                    background: rgba(255, 255, 255, 0.2);
                    border-color: rgba(255, 255, 255, 0.5);

                    .checkmark {
                        color: white;
                    }
                }
            }

            .checkbox-item {
                display: flex;
                flex-direction: column;
                align-items: center;
                width: 100%;

                .custom-checkbox {
                    width: 36rpx;
                    height: 36rpx;
                    border: 2rpx solid #d9d9d9;
                    border-radius: 50%;
                    margin-bottom: 16rpx;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    transition: all 0.3s ease;

                    .checkmark {
                        color: transparent;
                        font-size: 20rpx;
                        font-weight: bold;
                        transition: all 0.3s ease;
                    }
                }

                .checkbox-text {
                    font-size: 26rpx;
                    color: #333;
                    transition: all 0.3s ease;
                    line-height: 1.4;
                }
            }

            .hidden-checkbox {
                display: none;
            }
        }
    }

    .other-input-container {
        margin-top: 12px;
    }

    .other-input {

        border-bottom: 1px solid #f0f0f0;
    }
}

// 身份证上传组件样式
.id-card-upload-container {
    width: 100%;

    .id-card-sides {
        display: flex;
        gap: 24rpx;
        margin-bottom: 32rpx;

        .id-card-side {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;

            .side-label {
                font-size: 26rpx;
                color: #666;
                margin-bottom: 20rpx;
                font-weight: 500;
            }

            .upload-area {
                width: 100%;
                min-height: 240rpx;
                border: 2rpx dashed #e8e8e8;
                border-radius: 16rpx;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: all 0.3s ease;
                background: #fafafa;

                &:active {
                    border-color: #667eea;
                    background: #f0f4ff;
                }

                .id-card-btn {
                    background: transparent;
                    border: none;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    padding: 40rpx 20rpx;
                    width: 100%;

                    .upload-icon {
                        font-size: 48rpx;
                        margin-bottom: 16rpx;
                    }

                    .upload-text {
                        font-size: 26rpx;
                        color: #666;
                    }
                }

                .preview-container {
                    width: 100%;
                    padding: 20rpx;
                    display: flex;
                    flex-direction: column;
                    align-items: center;

                    .id-card-image {
                        width: 280rpx;
                        height: 180rpx;
                        border-radius: 12rpx;
                        border: 2rpx solid #e8e8e8;
                        margin-bottom: 20rpx;
                    }

                    .preview-actions {
                        display: flex;
                        gap: 16rpx;

                        .reupload-btn {
                            background: #667eea;
                            color: white;
                            border: none;
                            border-radius: 8rpx;
                            padding: 12rpx 24rpx;
                            font-size: 24rpx;
                        }

                        .remove-btn {
                            background: #ff4d4f;
                            color: white;
                            border: none;
                            border-radius: 8rpx;
                            padding: 12rpx 24rpx;
                            font-size: 24rpx;
                        }
                    }
                }
            }
        }
    }

    .ocr-loading {
        text-align: center;
        padding: 20rpx;
        background: #f0f4ff;
        border-radius: 12rpx;
        border: 1rpx solid #667eea;

        .loading-text {
            color: #667eea;
            font-size: 26rpx;
        }
    }
}

// OCR图片上传组件样式
.ocr-upload-container {
    width: 100%;

    .upload-section {
        width: 100%;
        min-height: 200rpx;
        border: 2rpx dashed #e8e8e8;
        border-radius: 16rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fafafa;
        margin-bottom: 32rpx;
        transition: all 0.3s ease;

        &:active {
            border-color: #667eea;
            background: #f0f4ff;
        }

        .ocr-upload-btn {
            background: transparent;
            border: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40rpx 20rpx;
            width: 100%;

            .upload-icon {
                font-size: 48rpx;
                margin-bottom: 16rpx;
            }

            .upload-text {
                font-size: 28rpx;
                color: #666;
                font-weight: 500;
            }
        }

        .preview-with-action {
            width: 100%;
            padding: 24rpx;
            display: flex;
            flex-direction: column;
            align-items: center;

            .ocr-preview-image {
                width: 320rpx;
                height: 200rpx;
                border-radius: 12rpx;
                border: 2rpx solid #e8e8e8;
                margin-bottom: 24rpx;
            }

            .preview-actions {
                display: flex;
                gap: 16rpx;
                flex-wrap: wrap;
                justify-content: center;

                .reupload-btn {
                    background: #667eea;
                    color: white;
                    border: none;
                    border-radius: 8rpx;
                    padding: 12rpx 24rpx;
                    font-size: 24rpx;
                }

                .remove-btn {
                    background: #ff4d4f;
                    color: white;
                    border: none;
                    border-radius: 8rpx;
                    padding: 12rpx 24rpx;
                    font-size: 24rpx;
                }

                .ocr-recognize-btn {
                    background: #52c41a;
                    color: white;
                    border: none;
                    border-radius: 8rpx;
                    padding: 12rpx 24rpx;
                    font-size: 24rpx;
                }
            }
        }
    }

    .ocr-loading {
        text-align: center;
        padding: 20rpx;
        background: #f0f9ff;
        border-radius: 12rpx;
        border: 1rpx solid #52c41a;
        margin-bottom: 24rpx;

        .loading-text {
            color: #52c41a;
            font-size: 26rpx;
        }
    }

    .ocr-result-container {
        background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
        border: 2rpx solid #e8f4ff;
        border-radius: 16rpx;
        padding: 32rpx;
        animation: slideUp 0.4s ease-out;

        .ocr-result-title {
            font-size: 28rpx;
            color: #333;
            font-weight: 600;
            margin-bottom: 24rpx;
            display: block;
        }

        .ocr-result-fields {
            display: flex;
            flex-direction: column;
            gap: 20rpx;
            margin-bottom: 32rpx;

            .ocr-result-field {
                display: flex;
                align-items: flex-start;

                .field-label {
                    font-size: 26rpx;
                    color: #666;
                    font-weight: 500;
                    min-width: 120rpx;
                }

                .field-value {
                    font-size: 26rpx;
                    color: #333;
                    flex: 1;
                    background: white;
                    padding: 16rpx 20rpx;
                    border-radius: 8rpx;
                    border: 1rpx solid #e8e8e8;
                }
            }
        }

        .apply-ocr-btn {
            background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
            color: white;
            border: none;
            border-radius: 12rpx;
            padding: 24rpx 32rpx;
            font-size: 28rpx;
            font-weight: 500;
            width: 100%;

            &:active {
                opacity: 0.8;
                transform: scale(0.98);
            }
        }
    }
}

// 动画效果
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20rpx);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

// 暗色模式支持
@media (prefers-color-scheme: dark) {

    .id-card-upload-container,
    .ocr-upload-container {

        .upload-area,
        .upload-section {
            background: #2d2d2d;
            border-color: #4a5568;

            .id-card-btn,
            .ocr-upload-btn {
                .upload-text {
                    color: #e2e8f0;
                }
            }
        }

        .ocr-loading {
            background: #2d3748;
            border-color: #4a5568;

            .loading-text {
                color: #e2e8f0;
            }
        }

        .ocr-result-container {
            background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
            border-color: #4a5568;

            .ocr-result-title {
                color: #e2e8f0;
            }

            .ocr-result-field {
                .field-label {
                    color: #cbd5e0;
                }

                .field-value {
                    background: #3a3a3a;
                    color: #e2e8f0;
                    border-color: #4a5568;
                }
            }
        }
    }
}